package com.tegtech.module.captcha.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import lombok.Getter;

/**
 * 验证码配置信息
 * @Author Jun
 * @date 2021年4月27日 下午6:17:42
 */
@Component
@ConfigurationProperties(prefix = "captcha")
public class CaptchaProperties {
	
	// 区别于其它验证码的key
	@Getter
    private static String key;
	
	// 验证码有效期，单位：秒
	@Getter
	private static Integer expireTime = 600;
	
	// 最小间隔发送时间，单位：秒
	@Getter
	private static Integer intervalTime = 60;
	
	// 验证码长度
	@Getter
	private static Integer codeLength = 5;
	
	// 每天最大发送次数， -1表示不限次数
	@Getter
	private static Integer maxNum = 10;

	public void setKey(String key) {
		CaptchaProperties.key = key;
	}

	public void setExpireTime(Integer expireTime) {
		CaptchaProperties.expireTime = expireTime;
	}
	
	public void setIntervalTime(Integer intervalTime) {
		CaptchaProperties.intervalTime = intervalTime;
	}

	public void setCodeLength(Integer codeLength) {
		CaptchaProperties.codeLength = codeLength;
	}
	
	public void setMaxNum(Integer maxNum) {
		CaptchaProperties.maxNum = maxNum;
	}

}
